﻿// -----------------------------------------------------------------------
// <copyright file="IImageEnchance.cs" company="FCIS">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------

namespace LastVersionOfIpPackage.ImageOperations
{
    using System;
    using System.Collections.Generic;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using Enum_needed;

    /// <summary>
    /// TODO: Update summary.
    /// </summary>
    public interface IImageEnchance
    {
        /// <summary>
        /// make Thresholds the specified image.
        /// </summary>
        /// <param name="image">The original image.</param>
        /// <param name="thresholdValue">The threshold value.</param>
        /// <returns>modified image</returns>
        Bitmap Threshold(Bitmap image, int thresholdValue);

        /// <summary>
        /// Open image.
        /// </summary>
        /// <param name="path">The path of image.</param>
        /// <returns>bitmap image</returns>
        Bitmap Open(string path);

        /// <summary>
        /// make Resizes in the specified image.
        /// </summary>
        /// <param name="image">The original image.</param>
        /// <param name="newWidth">The new width.</param>
        /// <param name="newHeigth">The new heigth.</param>
        /// <returns>modified image</returns>
        Bitmap Resize(Bitmap image, int newWidth, int newHeigth);

        /// <summary>
        /// Saves the  image.
        /// </summary>
        /// <param name="image">The image.</param>
        /// <param name="path">The path.</param>
        void Save(Bitmap image, string path);

        /// <summary>
        /// Saves as specify type.
        /// </summary>
        /// <param name="image">The image.</param>
        /// <param name="path">The path of save.</param>
        void SaveAs(Bitmap image, string path); ////type

        /// <summary>
        /// Converts to image from bitmap to another type.
        /// </summary>
        /// <param name="pathInput">The path input image.</param>
        /// <param name="pathOutput">The path output image save.</param>
        void ConvertTo(string pathInput, string pathOutput); ////type

        /// <summary>
        /// make Translate to the specified image.
        /// </summary>
        /// <param name="image">The image.</param>
        /// <param name="transValInX">The trans val in X.</param>
        /// <param name="transValInY">The trans val in Y.</param>
        /// <returns>modified image</returns>
        Bitmap Translate(Bitmap image, int transValInX, int transValInY);

        /// <summary>
        /// make Rotates to the specified image.
        /// </summary>
        /// <param name="image">The image.</param>
        /// <param name="angle">The angle of rotate.</param>
        /// <returns>modified image</returns>
        Bitmap Rotate(Bitmap image, double angle);

        /// <summary>
        /// make Grays to specified image.
        /// </summary>
        /// <param name="image">The image.</param>
        /// <returns>modified image</returns>
        Bitmap Gray(Bitmap image);

        /// <summary>
        /// Draws the histogram.
        /// </summary>
        /// <param name="colorNeed">The color need.</param>
        /// <param name="image">The image.</param>
        /// <param name="heigthOfImage">The heigth of image output .</param>
        /// <returns>result histogram</returns>
        Bitmap DrawHistogram(ColorNeed colorNeed, Bitmap image, int heigthOfImage);

        /// <summary>
        /// make Brigthnesse to specified image.
        /// </summary>
        /// <param name="image">The image.</param>
        /// <param name="offset">The offset of brigthness.</param>
        /// <returns>modified image</returns>
        Bitmap Brigthness(Bitmap image, int offset);

        /// <summary>
        /// make Contrast to specified image.
        /// </summary>
        /// <param name="image">The image.</param>
        /// <param name="offset">The offset of contrast.</param>
        /// <returns>modified image</returns>
        Bitmap Contrast(Bitmap image, int offset);

        /// <summary>
        /// make Gamma to specified image.
        /// </summary>
        /// <param name="image">The image.</param>
        /// <param name="gammaValue">The gamma value if large than 1 make dark to image else make brigthness off image.</param>
        /// <returns>modified image</returns>
        Bitmap Gamma(Bitmap image, double gammaValue);

        /// <summary>
        /// make Equalization to specified image.
        /// </summary>
        /// <param name="image">The image.</param>
        /// <returns>modified image</returns>
        Bitmap Equalization(Bitmap image);

        /// <summary>
        /// makke Matching to specified destination and source image.
        /// </summary>
        /// <param name="sourceImage">The source image.</param>
        /// <param name="destinationImage">The destination image would have efficient of source image.</param>
        /// <returns>modified image</returns>
        Bitmap Matching(Bitmap sourceImage, Bitmap destinationImage);

        /// <summary>
        /// make Negative to specified image.
        /// </summary>
        /// <param name="image">The image.</param>
        /// <returns>modified image</returns>
        Bitmap Negative(Bitmap image);

        /// <summary>
        /// make Add to specified image1+image2 with size of image1.
        /// </summary>
        /// <param name="image1">The image1.</param>
        /// <param name="image2">The image2.</param>
        /// <returns>modified image</returns>
        Bitmap Add(Bitmap image1, Bitmap image2);

        /// <summary>
        /// make Add to specified image1+image2 with size of image1.
        /// </summary>
        /// <param name="image1">The image1.</param>
        /// <param name="image2">The image2.</param>
        /// <param name="factor">The factor.</param>
        /// <returns>modified image</returns>
        Bitmap Add(Bitmap image1, Bitmap image2, double factor);

        /// <summary>
        /// make Sub to specified image1-image2 with size of image1.
        /// </summary>
        /// <param name="image1">The image1.</param>
        /// <param name="image2">The image2.</param>
        /// <returns>modified image</returns>
        Bitmap Sub(Bitmap image1, Bitmap image2);

        /// <summary>
        /// make Quantization to specified image.
        /// </summary>
        /// <param name="image">The image.</param>
        /// <param name="mask">The mask need apply.</param>
        /// <returns>
        /// modified image
        /// </returns>
        Bitmap Quantization(Bitmap image, int mask);

        /// <summary>
        /// make Mean the filter to specified image.
        /// </summary>
        /// <param name="image">The image.</param>
        /// <param name="meanOrSigma">The mean or sigma.</param>
        /// <param name="type">The type of smoothing.</param>
        /// <returns>
        /// modified image
        /// </returns>
        Bitmap SmoothingFilter(Bitmap image, double meanOrSigma, SmoothingType type);

        /// <summary>
        /// make Mean the filter to specified image.
        /// </summary>
        /// <param name="image">The image.</param>
        /// <param name="meanOrSigma">The mean or sigma.</param>
        /// <param name="d">The d.</param>
        /// <param name="type">The type of smoothing.</param>
        /// <returns>
        /// modified image
        /// </returns>
        Bitmap SmoothingFilter(Bitmap image, double meanOrSigma, int d, SmoothingType type);

        /// <summary>
        /// make Sharpening to specified image.
        /// </summary>
        /// <param name="image">The image.</param>
        /// <param name="mySharpingType">Type of my sharping.</param>
        /// <returns>
        /// modified image
        /// </returns>
        Bitmap Sharpening(Bitmap image, DetectionAndSharpingType mySharpingType);

        /// <summary>
        /// make Converts to freq.
        /// </summary>
        /// <param name="image">The image.</param>
        /// <returns>freq image</returns>
        Bitmap ConvertToFreq(Bitmap image);

        /// <summary>
        /// make Convert to spatial.
        /// </summary>
        /// <param name="image">The image.</param>
        /// <returns>modified image</returns>
        Bitmap ConvertToSpatial(Bitmap image);

         /// <summary>
        /// Converts to freq of specified color in image.
        /// </summary>
        /// <param name="image">The image.</param>
        /// <param name="myColor">color need return.</param>
        /// <returns>imagw of maguitude of this color</returns>
        Bitmap ConvertToFreq(Bitmap image, ColorNeed myColor);
 
        /// <summary>
        /// Adds the noise to specified image.
        /// </summary>
        /// <param name="image">The image.</param>
        /// <param name="ps">The ps probablity of salt.</param>
        /// <param name="pp">The pp probablity of paper.</param>
        /// <returns>
        /// noised image
        /// </returns>
        Bitmap AddSaltAndPepperNoise(Bitmap image, double ps, double pp);

        /// <summary>
        /// Adds the periodic noise.
        /// </summary>
        /// <param name="image">The image.</param>
        /// <param name="amplitude">The amplitude of noise.</param>
        /// <param name="frequencyInX">The frequency in X number of repetions in x axis.</param>
        /// <param name="frequenceInY">The frequence in Y number of repetions in y axis.</param>
        /// <param name="px">The px phase shift in x axis.</param>
        /// <param name="py">The py phase shift in y axis.</param>
        /// <returns>noised image</returns>
        Bitmap AddPeriodicNoise(Bitmap image, double amplitude, double frequencyInX, double frequenceInY, double px, double py);

        /// <summary>
        /// Adds the gaussian noise.
        /// </summary>
        /// <param name="image">The image.</param>
        /// <param name="mean">The mean of noise added.</param>
        /// <param name="sigma">The sigma.</param>
        /// <param name="precentage">The precentage of noise.</param>
        /// <returns>noised image</returns>
        Bitmap AddGaussianNoise(Bitmap image, double mean, double sigma, double precentage);

        /// <summary>
        /// Adds the noise to specified image.
        /// </summary>
        /// <param name="image">The image.</param>
        /// <param name="a">A start value of noise added.</param>
        /// <param name="b">The b the end value of noise added.</param>
        /// <param name="precentage">The precentage of noise in image.</param>
        /// <returns>
        /// noised image
        /// </returns>
        Bitmap AddUniformNoise(Bitmap image, int a, int b, double precentage);

        /// <summary>
        /// Adds the rayleigh noise.
        /// </summary>
        /// <param name="image">The image need add to it noise.</param>
        /// <param name="a">the A.</param>
        /// <param name="b">The b.</param>
        /// <param name="precentage">The precentage of noise.</param>
        /// <returns>
        /// modified image
        /// </returns>
        Bitmap AddRayleighNoise(Bitmap image, double a, double b, double precentage);

        /// <summary>
        /// Adds the gamma noise.
        /// </summary>
        /// <param name="image">The image need add to it noise.</param>
        /// <param name="a">the A.</param>
        /// <param name="b">The b.</param>
        /// <param name="precentage">The precentage of noise.</param>
        /// <returns>
        /// modified image
        /// </returns>
        Bitmap AddGammaNoise(Bitmap image, double a, int b, double precentage);

        /// <summary>
        /// Adds the exponential noise.
        /// </summary>
        /// <param name="image">The image need add to it noise.</param>
        /// <param name="landa">The landa of noise expon.</param>
        /// <param name="percentage">The percentage of noise.</param>
        /// <returns>
        /// noised image
        /// </returns>
        Bitmap AddExponentialNoise(Bitmap image, double landa, double percentage);
       
              /// <summary>
        /// Removes the noise from specified image.
        /// </summary>
        /// <param name="imag">The imag.</param>
        /// <param name="maskSize">Size of the mask.</param>
        /// <param name="myTypeOfFilter">My type of filter.</param>
        /// <returns>
        /// modified image
        /// </returns>
        Bitmap RemoveNoise(Bitmap imag, int maskSize, OrderStatisticType myTypeOfFilter);
       
        /// <summary>
        /// make HPF.
        /// </summary>
        /// <param name="image">The image.</param>
        /// <param name="filterTypeNeed">The filter type need.</param>
        /// <param name="maskTypeNeed">The mask type need.</param>
        /// <param name="d0">The distance between centar and point need make filter From it in HPF , LPF , Notch ,Band.</param>
        /// <param name="order">The order if you use gaussian else make it null or 0.</param>
        /// <param name="uc">The uc.</param>
        /// <param name="vc">The vc.</param>
        /// <returns>
        /// modified image
        /// </returns>
        Bitmap FilterOrRemoveNoiseFreq(Bitmap image, Enum_needed.FilterType filterTypeNeed, TypeOfMask maskTypeNeed, double d0, double order, double uc, double vc);
       
        /// <summary>
        /// apply Morphological to specified image.
        /// </summary>
        /// <param name="image">The image.</param>
        /// <param name="myMorphologyType">Type of my morphology need.</param>
        /// <param name="setB">The set B.</param>
        /// <param name="thresholdValue">The threshold value.</param>
        /// <param name="original">The original point in set b.</param>
        /// <returns>
        /// modified image
        /// </returns>
         Bitmap Morphological(Bitmap image, MorphologyType myMorphologyType, int[,] setB, int thresholdValue, Point original);

        /// <summary>
        /// make Edge detection to specified image.
        /// </summary>
        /// <param name="image">The image.</param>
        /// <param name="myEdgeType">Type of my edge.</param>
        /// <returns>modified image</returns>
        Bitmap EdgeDetection(Bitmap image, DetectionAndSharpingType myEdgeType); 

        /// <summary>
        /// Locals  histogram equalization.
        /// </summary>
        /// <param name="image">The image.</param>
        /// <param name="maskSize">Size of the mask.</param>
        /// <returns>The new image </returns>
        Bitmap LocalHistogramEqualization(Bitmap image, int maskSize);

        /// <summary>
        /// Locals statistics.
        /// </summary>
        /// <param name="image">The image.</param>
        /// <param name="maskSize">Size of the mask.</param>
        /// <param name="e">The e.</param>
        /// <param name="k0">The k0.</param>
        /// <param name="k1">The k1.</param>
        /// <param name="k2">The k2.</param>
        /// <returns>the new image</returns>
        Bitmap LocalStatistics(Bitmap image, int maskSize, int e, double k0, double k1, double k2);
    }
}
